package biz.datalk.industrialland.admin.config.properties;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.time.Duration;

/**
 * @author tarofang@163.com
 * @date 2023-09-05
 */
@Slf4j
@Getter
@Setter
@ToString
@ConfigurationProperties(CaptchaProperties.PREFIX)
public class CaptchaProperties {
    public static final String PREFIX = "datalk-captcha";

    /** 验证码宽度 */
    private int width = 105;
    /** 验证码高度 */
    private int height = 35;
    /** 行高 */
    private int lineWidth = 2;
    /** 字符个数 */
    private int codeLen = 4;
    /** 干扰线 */
    private int count = 200;
    /** 验证码随机种子 */
    private String codeSeed = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    /** 验证码失效时长，默认 2 分钟 */
    private Duration expire = Duration.ofMinutes(2L);
    /** 校验图形验证码时，忽略大小写 */
    private Boolean checkIgnoreCase = true;

}
